﻿package mortal.game.view.ThanksGiving.item
{
    import com.mui.controls.*;
    import com.mui.display.*;
    import mortal.common.swfPlayer.*;
    import mortal.common.swfPlayer.data.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class ThanksGivingTabCell extends GSprite implements ITabBar2Cell
    {
        protected var _bg:ScaleBitmap;
        protected var _selectFilter:ScaleBitmap;
        protected var _title:GImageBitmap;
        protected var _effSp:GSprite;
        protected var _canGetEffect:SWFPlayer;
        private var _active11TabData:ThanksGivingTabData;

        public function ThanksGivingTabCell()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._bg = UIFactory.bg(0, 2, 189, 56, this, ImagesConst.AchievemenListTabBtnBg);
            this._selectFilter = UIFactory.bg(-3, -2, 196, 64, this, ImagesConst.MountCardSelectBg);
            this._title = UIFactory.gImageBitmap(ImagesConst.CombinedSerTab1, 17, 19, this);
            this._effSp = UIFactory.getUICompoment(GSprite, 96, 30, this);
            this._canGetEffect = UIFactory.getUICompoment(SWFPlayer);
            this._canGetEffect.move(0, 0);
            this._canGetEffect.timeRate = 5;
            this._canGetEffect.load("guide_noName.swf", ModelType.NormalSwf, null);
            this.addChild(this._canGetEffect);
            this._effSp.addChild(this._canGetEffect);
            this._effSp.scaleX = 0.95;
            this._effSp.scaleY = 0.69;
            this._canGetEffect.stop();
            var _loc_1:Boolean = false;
            this._effSp.mouseEnabled = false;
            this._effSp.mouseEnabled = _loc_1;
            this._effSp.visible = false;
            this.mouseEnabled = true;
            this._selectFilter.visible = false;
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this._bg = null;
            this._selectFilter = null;
            this._title = null;
            this._effSp = null;
            this._canGetEffect = null;
            super.disposeImpl(param1);
            return;
        }// end function

        public function hasRw(param1:Boolean) : void
        {
            if (param1)
            {
                this._canGetEffect.play();
                this._effSp.visible = true;
            }
            else
            {
                this._canGetEffect.play();
                this._effSp.visible = false;
            }
            return;
        }// end function

        public function set selected(param1:Boolean) : void
        {
            this._selectFilter.visible = param1;
            return;
        }// end function

        public function set data(param1:Object) : void
        {
            this._active11TabData = param1 as ThanksGivingTabData;
            this._title.imgUrl = this._active11TabData.getImageHead();
            return;
        }// end function

        public function over() : void
        {
            return;
        }// end function

        public function out() : void
        {
            return;
        }// end function

    }
}
